//
//  TitleAndLineView.m
//  HZAPP
//
//  Created by huazi on 15/11/1.
//  Copyright © 2015年 huazi. All rights reserved.
//

#import "TitleAndLineView.h"

@implementation TitleAndLineView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self =[super initWithFrame:frame]) {
        [self initSubviews];
    }
    return self;
}
- (void)initSubviews {
    self.labelTitle =[[UILabel alloc] initWithFrame:CGRectMake(10, 2, 100, 26)];
    self.labelTitle.font =themeBoldFont15;
    self.labelTitle.textColor =[UIColor colorWithHexString:kcolorText999999];
    [self addSubview:self.labelTitle];
    
    self.viewLine =[[UIView alloc] initWithFrame:CGRectMake(120, 14.8, DeviceWidth-140, 0.3)];
    self.viewLine.backgroundColor =[UIColor colorWithHexString:kcolorline];
    [self addSubview:self.viewLine];
}
- (void)setStrTitleText:(NSString *)strTitleText {
    
    float widthText =[NSString calculateTextWidth:200 Content:strTitleText font:themeBoldFont15];
    self.labelTitle.text =strTitleText;
    self.labelTitle.frame =CGRectMake(10, 2, widthText+10, 26);
    self.viewLine.frame =CGRectMake(widthText+20, 14.8, DeviceWidth-widthText-30, 0.3);
}
@end
